<?php

use com\gdl\newagk\interfaces\UnitsServiceIf;
use com\gdl\common\dataobject\common\ResultDO;
use com\gdl\newagk\dataobject\units\UnitsDTO;
use com\gdl\newagk\dataobject\units\UnitsRequestDTO;

class api_UnitsService extends api_Abstract implements UnitsServiceIf
{
	
	//获得当前组织架构
	public function lookeOver(UnitsDTO $units)
    {
        $result = new ResultDO();
		$userid =$units->userId ? $units->userId : 0;
		$adminReg = $units->adminReg ? $units->adminReg : '';
		$unitid =$units->unitId ? $units->unitId : 0;
		$title =$units->filename['title'] ? $units->filename['title'] : '';
		$result->success = true;
		$result->code = 0;
		if(!$userid || empty($adminReg)){
            $result->message = '缺少参数';
            return $result;
		}

		try {
			/*****************/
			$agkunits = new model_lhbase_units();
			$adminuser = new model_lhbase_adminuser();
			$platform = new model_lhbase_platform();
			$authuserunits = new model_lhbase_authuserunits();
			/*$authuserunits->beginTransaction(); //批量写入
			$cc = $authuserunits->insertall([['unitsId'=>99,'adminUserId'=>99],['unitsId'=>99,'adminUserId'=>99],['unitsId'=>99,'adminUserId'=>99],['unitsId'=>99,'adminUserId'=>99]]);
			if($cc){
				$authuserunits->commit();
			} else {
				$authuserunits->rollBack();
			}
			*/

			$admin = $adminuser->selectOne(['id'=>$userid,'adminReg'=>$adminReg],'id,characters,platformId,unitsId');
			$unitsId = $authuserunits->select(['adminUserId'=>$userid],'unitsId')->items;
			
			if(empty($admin['id'])){
				$result->message = '账号错误';
				return $result;
			}
			$unitid = empty($unitsId) ? [0] : array_column($unitsId,'unitsId'); 
			$unitid = array_merge($unitid,[$admin['unitsId']]);
			$node = $agkunits->getMenuSpecial($admin['characters'],$admin['platformId'],$unitid,$title);

			/******end*********/
			$platformName = $platform->selectOne(['id'=>$admin['platformId']],'platformName');
			$platformNum = $adminuser->selectOne(['platformId'=>$admin['platformId']],'count(*) num');
			$datas = ['title'=>empty($platformName['platformName']) ? '未知' : $platformName['platformName'],'num'=>$platformNum['num'],'id'=>0];
			$result->datas[] = $datas;
            if (!empty($node)) {
			$result->data = $node;
			$result->code = 1;
		} else {
				$result->message = '没有数据';
		}
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	
	//添加或修改单位
	public function edit(UnitsDTO $units)
    {
        $result = new ResultDO();
		$field =$units->field ? json_decode($units->field,true) : [];

		$userid =$units->userId ? intval($units->userId) : 0;
		$result->success = true;
		$result->code = 0;
		if(empty($field) || empty($field['name'])){
				$result->message = '缺少参数';
				return $result;
		}
	
		
		try {
		
			$node = new model_lhbase_units();
			$agkPlatform = new model_newagk_platform();
			$appadminuser = new model_lhbase_appadminuser();
			
			$globas = new service_globals();
			

			$platformId = $appadminuser->selectOne(['id'=>$userid],'platformId');
			if(empty($platformId['platformId'])){
				$result->message = '管理员不存在';
				return $result;
			}
			
			
			$pinyin = new service_pinyin();
			$field['name'] = $globas->getStr($field['name']);
			$status = empty($field['status']) ? 1 : intval($field['status']);
			$names = $pinyin->getFirstPY($field['name']);
			$names = empty($names) ?  $globas->setUserToken(10) : $names;
			if($field['id']){
				$node->update(['id'=>$field['id']],['unitCode'=>$names,'unitName'=>$field['name'],'status'=>$status]);
			} else {
					$datime = time();
					$adminReg = $globas->get_random().$names;
					$levels = $node->selectOne(['id'=>$field['pid']],'level');
					$level = empty($levels['level']) ? 1 : $levels['level']+1;
					
					$manageLevel = $agkPlatform->selectOne(['id'=>$platformId['platformId']],'manageLevel');
					if($manageLevel['manageLevel'] && $manageLevel['manageLevel']<$level){
						$result->message = '创建失败，超过平台可创建层级';
						return $result;
					}
					$data = [
							'unitCode'=>$names,
							'platformId'=>$platformId['platformId'],
							'parentId'=>$field['pid'],//'上级单位id',
							'unitName'=> $field['name'],//'单位名',
							'createTime'=> $datime,//'单位创建时间',
							'updateTime'=> $datime,//'更新时间',
							//'adminReg'=> $reg,//'单位标记',
							'level'=> $level,//'第几级（暂定）',
							'userId'=>$userid,
							'status'=>$status,
							];
					$id = $node->insert($data);
					self::userUnitsAssoc(intval($id),$field['pid'],[$userid]);
			}
		$result->code = 1;
		$result->message = '成功';
		return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	
	//修改部门状态
	public function enabled(UnitsRequestDTO $units)
    {
        $result = new ResultDO();
		$userid =$units->userId ? $units->userId : 0;
		$adminReg = $units->adminReg ? $units->adminReg : '';
		$unitid =$units->unitId ? $units->unitId : 0; //被修改部门的 部门id
		$status = $units->filename['status'] ? intval($units->filename['status']) : 2;
		$operating = $units->filename['operating'] ? $units->filename['operating'] : 'status';
		$result->success = true;
		$result->code = 0;
		if(!$userid || empty($adminReg) || !$unitid){
            $result->message = '缺少参数';
            return $result;
		}

		try {
			/*****************/
			$agkunits = new model_lhbase_units();
			$authuserunits = new model_lhbase_authuserunits();
			$authgroup = new model_lhbase_authgroup();
			//$adminrole = new model_lhbase_adminrole();
			$types = $agkunits->enabled($userid,$adminReg,$unitid);
			if($types['code']!='y'){
				$result->message = $types['msg'];
				return $result;
			}
			
			if($operating=='status'){
				$agkunits->update(['id'=>$unitid],['status'=>$status]);
				/******end*********/
				$status = $agkunits->selectOne(['id'=>$unitid],'status'); //以防万一查询一次
				$result->data[]['status'] = intval($status['status']);
				$result->message = '修改成功';
			} else if($operating=='deletes'){
				//删除操作
				/**查询是否有下级***/
				$superior = $agkunits->selectOne(['parentId'=>$unitid,'isDelete'=>1],'id');
				
				if ($types['mark']['characters']=='zg' && !$types['mark']['unitsId']) {
					 $userunitsId= $agkunits->select('isDelete=1','id')->items;
					$agkUnitsUserId = empty($userunitsId) ? [0] : array_column($userunitsId,'id');
				} else {
					$userunitsId= $authuserunits->select(['adminUserId'=>$userid],'unitsId')->items; //获取用户具有的权限
					$unitsid = empty($userunitsId) ? [$types['mark']['unitsId']] : array_merge([$types['mark']['unitsId']],array_column($userunitsId,'unitsId'));
					$agkUnitsUserId = $agkunits->operating($types['mark']['platformId'],$unitsid);
				}
				
				if(!empty($superior['id'])){
					if(in_array($superior['id'],$agkUnitsUserId)){
						$result->message = '删除失败，请先删除下级单位';
						return $result;
					}
				}
				$adminuser = new model_lhbase_appadminuser();
				
				$member = new model_attendance_member();
				
				$unitIdDelete = $agkunits->operating($types['mark']['platformId'],$unitid);
				$personnel = $adminuser->selectOne('unitsId in('.implode(',',$unitIdDelete).') and isDelete=1','count(*) num');
				$memberper= $member->selectOne('unitId in('.implode(',',$unitIdDelete).')','count(*) num');
				
				if($memberper['num']){
					$result->message = '删除失败，请先清空用户';
					return $result;
				} else {
					if(!$personnel['num']){
						$agkunits->update(['id'=>$unitid],['isDelete'=>2]);
					}
					
					$authuserunits->delete(['adminUserId'=>$userid,'unitsId'=>$unitid]); //删掉关联关系
					/******删除管理员一条线下所有人员的权限*
					$attributionGroup = $authgroup->select(['attribution'=>$userid],'id')->items;
					
					if(!empty($attributionGroup)){
					$groupIdArr = array_column($attributionGroup,'id');
					$userIdDelete = $agkunits->subordinateId($groupIdArr);
						if(!empty($userIdDelete)){ //去掉下级所有用户对应的部门
								$authuserunits->delete('adminUserId in('.implode(',',$userIdDelete).') and unitsId='.$unitid);
						}
					}*****/
					/******删除管理员一条线下所有人员的权限 end******/
					
					/**删除权限组**/
					//$adminrole->update(['unitsId'=>$unitid],['isDelete'=>2]);
					
					$result->message = '删除成功';
				}
				/**查询当前单位是否有人员绑定***/
				
			}
            $result->code = 1;
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	
	//添加修改管理员 【添加批量】
	public function adminEdit(UnitsDTO $units)
    {
		$result = new ResultDO();
		$userid =$units->userId ? $units->userId : 0;
		$adminReg = $units->adminReg ? $units->adminReg : '';
		$administr = $units->filename ? $units->filename : [];
		$appId = 1;
		$result->success = true;
		$result->code = 0;
		if(!$userid || empty($adminReg) || empty($administr['realName']) || empty($administr['groupId'])  || empty($administr['unitsId'])  || !$administr['groupId'] ){
            $result->message = '缺少参数';
            return $result;
		}

		try {
			/*****************/

			$adminuser = new model_lhbase_appadminuser();
			$authuseraccess = new model_lhbase_authuseraccess();
			$authgrouprule = new model_lhbase_authgrouprule();
			$authgroupaccess = new model_lhbase_authgroupaccess();
			$agkunits = new model_lhbase_units();
			$authgroup = new model_lhbase_authgroup();
			$authuserunits = new model_lhbase_authuserunits();
	
			$platform = new model_lhbase_platform();
			$adminPlatform = $adminuser->selectOne(['id'=>$userid],'characters,platformId,unitsId');
			/*******判断权限*********/
			if($adminPlatform['characters']=='zg' &&  !$adminPlatform['unitsId']){
				$adminUnits = $agkunits->select('isDelete=1','id')->items;
				$adminUnitsId = empty($adminUnits) ? [-1] : array_column($adminUnits,'id');
			} else {
				$userunits = $authuserunits->select(['adminUserId'=>$userid],'unitsId')->items;
				$userunitsId = empty($userunits) ? [-1] : array_column($userunits,'unitsId');
				$adminUnitsId = $agkunits->operating($adminPlatform['platformId'],array_merge($userunitsId,[$adminPlatform['unitsId']]));
			}
			if(!in_array($administr['unitsId'],$adminUnitsId)){
				
				$result->message = '没有权限';
				return $result;
				
			}
			
			
			/******判断权限 end******/
			$globas = new service_globals();

			$passsalt = $globas->setUserToken(8);
			
			$unitsLeve =  $agkunits->selectOne(['id'=>$administr['unitsId']],'level');
			$level = empty($unitsLeve) ? 0 : $unitsLeve['level'];
			
			
			
			if($administr['userId']){
				$administrUserDel = $adminuser->selectOne(['id'=>$administr['userId']],'unitsId');
		
				$data = ['realName'=>$administr['realName'],'mobile'=>$administr['mobile'],'unitsId'=>$administr['unitsId'],'level'=>$level,'groupId'=>$administr['groupsId']];
				if(!empty($administr['passWord'] && $administr['passWord']!='******')){
				
					$data['password'] = parent::dpassword($administr['passWord'] , $passsalt);
					$data['passsalt'] = $passsalt;
				}
				$adminuser->update(['id'=>$administr['userId']],$data);
				$authgroupaccess->delete(['uId'=>$administr['userId']]);
				if($administrUserDel['unitsId']!=$administr['unitsId']){
					$authuserunits->delete(['unitsId'=>$administrUserDel['unitsId'],'adminUserId'=>$administr['userId']]); //删除原有得默认部门关联
					
				}
			} else {
				$adminDel = $adminuser->selectOne("account='{$administr['userName']}' and isDelete=1",'id');//realName='{$administr['realName']}' or 
		
			
				
				if(empty($adminDel['id'])){
					$adminReg = $globas->get_random().$administr['userName'];
					
					$administr['userId'] = $adminuser->insert(['account'=>$administr['userName'],'passsalt'=>$passsalt,'password'=>parent::dpassword($administr['passWord'] , $passsalt),'realName'=>$administr['realName'],'mobile'=>$administr['mobile'],'userType'=>1,'platformId'=>$adminPlatform['platformId'],'characters'=>'gl','adminReg'=>$adminReg,'unitsId'=>$administr['unitsId'],'level'=>$level,'groupId'=>$administr['groupsId']]);
					
					//$adminPlatform['unitsId']
				} else {
					$result->message = '管理员已经存在';
					return $result;
				}
			}
			/******end*********/
			
			
			if($administr['userId']>1){
				$authgroupaccess->insert(['uId'=>$administr['userId'],'groupId'=>$administr['groupId']]);
				
				/*****临时添加个人权限*****/
				
				$autRuleId = $authgrouprule->select(['groupId'=>$administr['groupId']],'ruleId')->items;
				$ruleId = empty($autRuleId) ? [0] :array_column($autRuleId,'ruleId');
				$authuseraccess->delete(['userId'=>$administr['userId'],'groupId'=>$administr['groupId']]);
				$data = [];
				foreach($ruleId as $v){
					$data[] = [
							'userId'=>$administr['userId'], 
							'ruleId'=>$v,
							'groupId'=>$administr['groupId'],
							'platformId'=>$adminPlatform['platformId'],
							'appId'=>$appId,
							];
				}
											
					if(!empty($data)){
						$authuseraccess->beginTransaction(); //批量写入
						$authuseraInser = $authuseraccess->insertall($data);
						if($authuseraInser){
							$authuseraccess->commit();
						} else {
							$authuseraccess->rollBack();
						}
					}
				$result->data[]['userid'] = $administr['userId'];

				$result->code = 1;
				$result->message = '操作成功';
			} else {
				$result->message = '操作失败';
			}
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	
	/*修改部门下所有权限组
	*groupsid int 权限组id  如果存在就是修改指定权限组
	*userid int  管理员id
	*/
	public function listEnabled(UnitsRequestDTO $units)
    {
        $result = new ResultDO();
		$userid =$units->userId ? $units->userId : 0;
		$adminReg = $units->adminReg ? $units->adminReg : '';

		$status = $units->filename['status'] ? intval($units->filename['status']) : 2;
		$groupsid = $units->filename['groupsid'] ? intval($units->filename['groupsid']) : 0;
		$operating = $units->filename['operating'] ? $units->filename['operating'] : '';
		$result->success = true;
		$result->code = 0;
		if(!$userid || empty($adminReg) || empty($operating)){
			$result->message = '缺少参数';
			return $result;
		}

		try {
			/*****************/
			$agkunits = new model_lhbase_units();
			$adminuser = new model_lhbase_appadminuser();
			$adminrole = new model_lhbase_authgroup();
			$adminaccess = new model_lhbase_adminaccess();
			$authgrouprule = new model_lhbase_authgrouprule();
			$adminDel = $adminuser->selectOne(['id'=>$userid],'characters');
			if($adminDel['characters']=='zg'){
				$condition= ['id'=>$groupsid];
			} else {
				$condition= ['attribution'=>$userid,'id'=>$groupsid];
			}

			if($operating=='status'){
				$adminrole->update($condition,['status'=>$status]);
			} else if($operating=='del'){
				if($adminuser->checkGroup($groupsid)){

					$adminrole->delete($condition);
					$authgrouprule->delete(['groupId'=>$groupsid]);
				//	$adminrole->delete($condition);
				} else {
					$result->message = '权限组管理员未清空';
					return $result;
				}
			}
			/******end*********/
			$result->data[]=['status'=>$status==2 ? 1 : 2];
			$result->code = 1;
			$result->message = '操作成功';
			
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	//管理员列表
	public function adminList(UnitsDTO $units)
    {
        $result = new ResultDO();
		$adminUserId =$units->userId ? intval($units->userId) : 0;
		$adminReg = $units->adminReg ? $units->adminReg : '';
		$title =$units->filename['title'] ? $units->filename['title'] : '';
		$unitsId =$units->filename['unitsId']>-9 ? $units->filename['unitsId'] : 0;
		
		$result->success = true;
		$result->code = 0;
		if(!$adminUserId || empty($adminReg)){
				$result->message = '缺少参数';
				return $result;
		}

		try {
			$appadminuser = new model_lhbase_appadminuser();
			$units = new model_lhbase_units();
			$platform = new model_lhbase_platform();
			$authuserunits = new model_lhbase_authuserunits();
			$adminrole = new model_lhbase_authgroup();
			
			
		//	$adminUnitsId = $appadminuser->operating($adminUserId,$adminReg);
		
			
			$appadminuserGroup = $appadminuser->selectOne(['id'=>$adminUserId],'characters,platformId,unitsId');
			$groupList = $adminrole->attendanceGroup($appadminuserGroup['platformId']);//获取所有考勤组
			
			if($appadminuserGroup['characters']=='zg' &&  !$appadminuserGroup['unitsId']){

				$adminUnits = $units->select('isDelete=1','id')->items;
				
				$adminUnitsId = empty($adminUnits) ? [-1] : array_column($adminUnits,'id');
				$adminUnitsId[] = 0;
			} else {
				$userunits = $authuserunits->select(['adminUserId'=>$adminUserId],'unitsId')->items;
				$userunitsId = empty($userunits) ? [-1] : array_column($userunits,'unitsId');
				$adminUnitsId = $units->operating($appadminuserGroup['platformId'],array_merge($userunitsId,[$appadminuserGroup['unitsId']]));
			}

			if(!in_array($unitsId,$adminUnitsId)){
				//if($unitsId<0  && $title!=''){} else {
				if($unitsId==-1){} else {
				$result->message = '没有权限';
				return $result;
				}
			}

			if($appadminuserGroup['characters']=='gl' && $unitsId==$appadminuserGroup['unitsId']){
				$result->message = '没有权限';
				return $result;
			}
		//	$unitsName = $units->selectOne('id='.$unitsId,'unitName');
			
			//if($unitsId==-1 && $title!=''){
			if($unitsId==-1){
				$condition = 'unitsId in('.implode(',',$adminUnitsId).') and isDelete=1 and id<>'.$adminUserId;
			} else {
				$condition = 'unitsId='.$unitsId.' and isDelete=1 and id<>'.$adminUserId.' and unitsId in('.implode(',',$adminUnitsId).')';
			}
			if($appadminuserGroup['characters']=='gl'){
				$condition .= " and characters='gl'";
			}
			if($title!=''){
				$condition .= " and ( account like '%{$title}%' or realName like '%{$title}%' ) ";
			}
			$res = $appadminuser->getInfoArg($condition,'id,account userName,platformId,status,realName,unitsId,groupId');

			
			$platformId = $appadminuser->selectOne('id='.$adminUserId,'platformId');
			
			$unitsName = $units->unitsDetails($platformId['platformId'],$adminUnitsId);
			$platformName = $platform->selectOne('id='.$platformId['platformId'],'platformName');

			$list = [];
	
			foreach($res as $v){
				$list[] = [
						'id'=>$v['id'],
						'userName'=>$v['userName'],
						'platformId'=>$v['platformId'],
						'status'=>$v['status'],
						'realName'=>$v['realName'],
						'unitsId'=>$v['unitsId'],
						'unitName'=>empty($unitsName[$v['unitsId']]) ?  $platformName['platformName'] : $unitsName[$v['unitsId']],
						'groupName'=>empty($groupList[$v['groupId']]) ? '无权限组' : $groupList[$v['groupId']],
						];
			}
			if(!empty($list)){
				$result->code = 1;
				$result->data = $list;
				$result->message = '成功';
			} else {
				$result->code = 1;
				$result->message = '成功';
			}
			
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}

	//添加或修改单位
	public function managements(UnitsDTO $units)
    {
        $result = new ResultDO();
	
		$userid =$units->userId ? $units->userId : 0;
		$adminReg =$units->adminReg ? $units->adminReg : 0;
		$unitid =$units->unitId ? $units->unitId : 0;
		$result->success = true;
		$result->code = 0;
		if(!$userid){
			$result->message = '缺少参数';
			return $result;
		}
		
		try {
			/*****************/
			$adminrole = new model_lhbase_adminrole();
			$adminuser = new model_lhbase_adminuser();
			$units = new model_lhbase_units();
			/*****获取所有单位*****/
			$platform = $adminuser->selectOne(['id'=>$userid],'platformId');
			$list = $units->getLIst($platform['platformId']);
			
			/******end*********/
			$res = $units->managements($list,$userid,$platform['platformId']);

			if(empty($res)){
				$result->message = '失败';
			} else {
				$result->data = $res;
				$result->code = 1;
				$result->message = '成功';
			}
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	
	//获取管理员基本信息
	public function adminLook(UnitsDTO $units)
    {
        $result = new ResultDO();
		$adminUserId = $units->userId ? $units->userId : 0;
		$result->success = true;
		$result->code = 0;
		if(!$adminUserId){
			$result->message = '缺少参数';
			return $result;
		}

		try {
			/*****************/

			$appadminuser = new model_lhbase_appadminuser();
			$authgroupaccess = new model_lhbase_authgroupaccess();
			$authgroup = new model_lhbase_authgroup();

			$adminuserDel = $appadminuser->selectOne(['id'=>$adminUserId,'isDelete'=>1],'id,realName,mobile,account userName,unitsId');

			/******end*********/
			
			if(empty($adminuserDel)){
				$result->code = 1;
				$result->message = '管理员不存在';
			} else {
				$adminuser = ['id'=>$adminuserDel['id'],'realName'=>$adminuserDel['realName'],'mobile'=>$adminuserDel['mobile'],'userName'=>$adminuserDel['userName'],'groupId'=>0,'unitsId'=>$adminuserDel['unitsId']];
				$access = $authgroupaccess->selectOne(['uId'=>$adminUserId],'groupId');
				if(!empty($access)) $adminuser['groupId'] = $access['groupId'];
				$adminuser['password'] = '******';
				$result->data[] = $adminuser;
				$result->code = 1;
				$result->message = '成功';
			}
            return $result;
        } catch (Exception $e) {
            $result->success = false;
            $result->code = 0;
            $result->message = '未知错误';
        }
        return $result;
	}
	public function userUnitsAssoc($id=0,$UnitsId,$userId=[0],$hisUser=[0]){
		if(!$id || empty($userId)) return true;

		$UnitsId = intval($UnitsId);
		$appadminuser = new model_lhbase_appadminuser();
		$units = new model_lhbase_units();
		$authuserunits = new model_lhbase_authuserunits();
		$userUnitsId = $authuserunits->select('unitsId='.$UnitsId.' and adminUserId in('.implode(',',$userId).')','adminUserId')->items;
		if(!empty($userUnitsId) ){
			$adminUserId = array_column($userUnitsId,'adminUserId');
			$adminUserId = array_diff($adminUserId,$hisUser);
			$hisUser=array_merge($hisUser,$adminUserId);
			if(!empty($adminUserId)){
				foreach($adminUserId as $v){
					$data = [
							'unitsId' => $id,
							'adminUserId' => $v,
							];
					$authuserunits->insert($data);
				}
			}
		}
		$UnitId = $units->selectOne(['parentId'=>$UnitsId],'id');
		if(!empty($UnitId)){
			$adminUserId = $authuserunits->select('unitsId='.$UnitId['id'],'adminUserId')->items;
			$userid = empty($adminUserId) ? [0] : array_column($adminUserId,'adminUserId');
			self::userUnitsAssoc($id,$UnitId['id'],$userid,$hisUser);
		}
		return true;
	
		
		
	}
}
